package com.ruoyi.front.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.front.mapper.ServiceOrganizationLawyerMapper;
import com.ruoyi.front.domain.ServiceOrganizationLawyer;
import com.ruoyi.front.service.IServiceOrganizationLawyerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 服务组织律师关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-07
 */
@Service
public class ServiceOrganizationLawyerServiceImpl implements IServiceOrganizationLawyerService 
{
    @Autowired
    private ServiceOrganizationLawyerMapper serviceOrganizationLawyerMapper;

    /**
     * 查询服务组织律师关系
     * 
     * @param id 服务组织律师关系ID
     * @return 服务组织律师关系
     */
    @Override
    public ServiceOrganizationLawyer selectServiceOrganizationLawyerById(Long id)
    {
        return serviceOrganizationLawyerMapper.selectServiceOrganizationLawyerById(id);
    }

    /**
     * 查询服务组织律师关系列表
     * 
     * @param serviceOrganizationLawyer 服务组织律师关系
     * @return 服务组织律师关系
     */
    @Override
    public List<ServiceOrganizationLawyer> selectServiceOrganizationLawyerList(ServiceOrganizationLawyer serviceOrganizationLawyer)
    {
        return serviceOrganizationLawyerMapper.selectServiceOrganizationLawyerList(serviceOrganizationLawyer);
    }

    /**
     * 新增服务组织律师关系
     * 
     * @param serviceOrganizationLawyer 服务组织律师关系
     * @return 结果
     */
    @Override
    public int insertServiceOrganizationLawyer(ServiceOrganizationLawyer serviceOrganizationLawyer)
    {
        serviceOrganizationLawyer.setCreateTime(DateUtils.getNowDate());
        return serviceOrganizationLawyerMapper.insertServiceOrganizationLawyer(serviceOrganizationLawyer);
    }

    /**
     * 修改服务组织律师关系
     * 
     * @param serviceOrganizationLawyer 服务组织律师关系
     * @return 结果
     */
    @Override
    public int updateServiceOrganizationLawyer(ServiceOrganizationLawyer serviceOrganizationLawyer)
    {
        serviceOrganizationLawyer.setUpdateTime(DateUtils.getNowDate());
        return serviceOrganizationLawyerMapper.updateServiceOrganizationLawyer(serviceOrganizationLawyer);
    }

    /**
     * 删除服务组织律师关系对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteServiceOrganizationLawyerByIds(String ids)
    {
        return serviceOrganizationLawyerMapper.deleteServiceOrganizationLawyerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除服务组织律师关系信息
     * 
     * @param id 服务组织律师关系ID
     * @return 结果
     */
    @Override
    public int deleteServiceOrganizationLawyerById(Long id)
    {
        return serviceOrganizationLawyerMapper.deleteServiceOrganizationLawyerById(id);
    }
}
